/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Programas_En_Clase;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author gurrola
 */

public class Rimas {

    public static void main (String [] args) throws IOException {

      try {

         File f = new File("archivo.txt");
         FileReader f1 = new FileReader(f);

         BufferedReader br = new BufferedReader(f1);
         String linea=br.readLine();
         String linea2=br.readLine();
         String linea3=br.readLine();
         String linea4=br.readLine();

            System.out.println(linea);
            System.out.println(linea2);
            System.out.println(linea3);
            System.out.println(linea4);

            if(linea.endsWith(linea3.substring(linea3.length()-3, linea3.length()))
               &&linea2.endsWith(linea4.substring(linea4.length()-3, linea4.length()))){

               System.out.println("Son Rimas");
            }
            else{
                System.out.println("No son Rimas");
            }
        } catch (Exception ex) {
            ex.equals(ex);
        }

    }
}


